package com.victor.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 回答表
 * 
 * @author Mr.Zhang
 *
 */
@Entity
@Table(name = "answer")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Answer {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) // 主键类型--自动递增生成
	@Column(name = "id", unique = true, nullable = false, length = 11)
	private Integer id;// 主键id

	@Column(name = "q_id", length = 11)
	private String q_id;// 提问表id

	@Column(name = "a_userid", length = 11)
	private String a_userid;// 回答人id

	@Column(name = "a_content", length = 500)
	private String a_content;// 回答内容

	@Column(name = "a_filepath", length = 500)
	private String a_filepath;// 回答 图片或视频地址

	@Column(name = "a_time", length = 50)
	private String a_time;// 提问发布时间

	@Column(name = "ifadopt", length = 1)
	private String ifadopt;// 是否采纳 (0.未采纳,1 已采纳)
	
	@Transient
	private String u_nickname; // 昵称
	
	@Transient
	private String u_avatar; // 头像
	
	@Transient
	private YhUsers a_user;// 回答的用户信息

	@Transient
	private List<Praise> praise;// 点赞list

	@Transient
	private List<Comment> comment;// 评论list
}
